package com.stlm2.dems.user.entity.base;

import com.stlm2.dems.user.entity.UserRolePrivilegeType;

import java.io.Serializable;

/**
 * Created by ZLQ on 2017/7/11.
 */
public class BaseUserRolePrivilege implements Serializable {
    //ID主键
    private int id;
    //角色ID
    private int  roleId;
    //用户ID
    private int userId;
    //用户角色资源类型1：资源分配为角色 2：资源分配给用户
    private UserRolePrivilegeType userRolePrivilegeType;
    //系统资源ID
    private int systemPrivilegeId;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getRoleId() {
        return roleId;
    }

    public void setRoleId(int roleId) {
        this.roleId = roleId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public UserRolePrivilegeType getUserRolePrivilegeType() {
        return userRolePrivilegeType;
    }

    public void setUserRolePrivilegeType(UserRolePrivilegeType userRolePrivilegeType) {
        this.userRolePrivilegeType = userRolePrivilegeType;
    }

    public int getSystemPrivilegeId() {
        return systemPrivilegeId;
    }

    public void setSystemPrivilegeId(int systemPrivilegeId) {
        this.systemPrivilegeId = systemPrivilegeId;
    }

    public Integer getUserRolePrivilegeTypeValue() {
        return (userRolePrivilegeType != null) ? userRolePrivilegeType.getIntValue() : null;
    }

    public void setUserRolePrivilegeTypeValue(Integer value) {
        if (value != null)
            this.userRolePrivilegeType = UserRolePrivilegeType.getByIntValue(value);
    }
}
